/********************************************
 * 功能说明: 
 * 模块名称: 
 * 系统名称: 
 * 软件版权: Frank
 * 系统版本: 1.0.0
 * 开发人员: Frank
 * 开发时间: 2019/12/11 15:42
 * 审核人员: 
 * 相关文档: 
 * 修改记录: 修改日期 修改人员 修改说明
 *********************************************/
package com.spring.arch;

import com.spring.arch.common.setup.ApplicationSetup;
import com.spring.arch.common.setup.ApplicationSetup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

/**
 * 启动类
 *
 * @author Frank
 * @version 1.0.0.1
 * @since 2019/12/11 15:42
 */
@EnableDiscoveryClient
@EnableAuthorizationServer
@EnableResourceServer
@SpringBootApplication
@EnableFeignClients
@EnableHystrix
public class UAAApplication implements CommandLineRunner {

    @Autowired
    private ApplicationSetup applicationSetup;

    @PostConstruct
    void init() {
        // 系统级设置
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
    }

    public static void main(String[] args) {
        SpringApplication.run(UAAApplication.class, args);
    }


    @Override
    public void run(String... args) {
        applicationSetup.init(args);
    }
}
